Xbasic

SYS_SEND_KEYS Function

Syntax

N SYS_SEND_KEYS(C key_macro)

Arguments

String_of_Keys

The keystrokes to process. To specify a particular keyboard character, use the character itself (e.g., D for the D key).

Key

Code

backspace

{BACKSPACE} or {BS} or {BKSP}

break

{BREAK}

caps lock

{CAPSLOCK}

clear

{CLEAR}

delete

{DELETE}

down arrow

{DOWN}

end

{end}

enter

{ENTER}

esc

{ESC}

help

{HELP}

home

{HOME}

insert

{INSERT}

left arrow

{LEFT}

num lock

{NUMLOCK}

page down

{PGDN}

page up

{PGUP}

print screen

{PRTSC}

right arrow

{RIGHT}

scroll lock

{SCROLLOCK}

tab

{TAB}

up arrow

{UP}

F1

{F1}

F2

{F2}

F3

{F3}

F4

{F4}

F5

{F5}

F6

{F6}

F7

{F7}

F8

{F8}

F9

{F9}

F10

{F10}

F11

{F11}

F12

{F12}

key_macro

To include special characters that are not displayed when a key is pressed (such as ENTER or TAB ) and other keyboard actions, use one of the following special key codes. You can use each regular key in combination with the special keys: SHIFT, CTRL, and ALT. To specify a combination key press, precede the regular key code with one of the following special key codes:

Key

Code

shift

+ or SHIFT-

ctrl

^ or CTRL-

alt

% or ALT-

Example

To send Ctrl-M, use "{^M}", or "{CTRL-M}". To send Shift-Ctrl-V use "{Shift-Ctrl-V}" or "{ + ^V}".

Description

SYS_SEND_KEYS() sends the specified keys to the active window. The String_of_Keys parameter is a character string that can include one or more keys, as well as special extended keys like function keys and cursor keys.

Example

This script can be attached to OnArrive event for a field on a form. It will move the insertion point to the beginning of the field.

sys_send_keys("{f2}{home}")

Limitations

Desktop applications only.

See Also